package com.darrenchan.leetcode;

import java.util.Arrays;

/**
 * @Desc
 * @Author chenchi03
 * @CreateTime 2019-11-26 22:05
 */
public class Q344 {
    public void reverseString(char[] s) {
        int len = s.length;
        for (int i = 0; i < len / 2; i++) {
            char temp = s[i];
            s[i] = s[len - i - 1];
            s[len - i - 1] = temp;
        }
    }

    public static void main(String[] args) {
        char[] cc = new char[]{'h','e','l','l','o'};
        new Q344().reverseString(cc);
        System.out.println(Arrays.toString(cc));
    }
}
